package cn.xanderye.eureka.client.controller;

import cn.xanderye.hello.service.api.dto.User;
import cn.xanderye.hello.service.api.service.HelloService;
import org.springframework.web.bind.annotation.*;

/**
 * Created on 2020/1/9.
 *
 * @author 叶振东
 */
@RestController
public class RefactorHelloController implements HelloService {

    @Override
    public String hello(@RequestParam String name) {
        return "Hello " + name;
    }

    @Override
    public User hello(@RequestHeader String name, @RequestHeader Integer age) {
        return new User(name, age);
    }

    @Override
    public String hello(@RequestBody User user) {
        return "Hello " + user.getName() + "," + user.getAge();
    }
}
